A monitoring device, such as, for example, a camera, may be installed to capture images of an area of interest. When a technician installs the monitoring device, the technician may configure the monitoring device to be focused on a particular object, or a particular aspect, in the area of interest. The monitoring device may be focused by adjusting a front focus and a back focus. The front focus may depend on the distance from a lens to an object, or aspect, of the area of interest. The back focus may depend on the distance between a lens and a sensor area of the monitoring device that captures images of the area of interest. It may be desirable to keep the focus set during installation to be as stable as possible. Changes in the environment may affect the back focus, by, for example, moving optical elements and/or sensor elements of the monitoring device. Therefore, the back focus may need to be compensated based on changes in the environment.